{% extends "common/layout.html" %}
{% block content %}
    <section class="search">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <div class="search-result">
                        Search results for keyword "{{ str }}" found in {{ pages.total_count }} posts.
                    </div>
                    <div class="row">
                        {% for item in newsl %}
                            <article class="col-md-12 article-list">
                                <div class="inner">
                                    <figure>
                                        <a href="{{ buildUrl("single")~"?id="~item.id }}">
                                            <img src="{{ pic_path ~ item.hash~ ".jpg" }}" height="195" width="300">
                                        </a>
                                    </figure>
                                    <div class="details">
                                        <div class="detail">
                                            <div class="category">
                                                <a href="#">{{ item.genres }}</a>
                                            </div>
                                            <time>{{ item.date }}</time>
                                        </div>
                                        <h1><a href="{{ buildUrl("single")~"?id="~item.id }}">{{ item.title }}</a></h1>
                                        <p>{{ (item.text | truncate_html(length=150)) ~ '...' }}</p>
                                        <footer>
                                            <a class="btn btn-primary more" href="{{ buildUrl("single")~"?id="~item.id }}">
                                                <div>More</div>
                                                <div><i class="ion-ios-arrow-thin-right"></i></div>
                                            </a>
                                        </footer>
                                    </div>
                                </div>
                            </article>
                        {% endfor %}
                        {% if pages.total_count > 10 %}
                            {% include "common/pagenation.html" %}
                        {% endif %}
                    </div>
                </div>
            </div>
        </div>
    </section>
{% endblock %}
